winsafe\mf\com_interfaces/
imftopologynode.rs1#![allow(non_camel_case_types, non_snake_case)]
2
3use crate::co;
4use crate::decl::*;
5use crate::mf::vts::*;
6use crate::ole::privs::*;
7use crate::prelude::*;
8
9com_interface! { IMFTopologyNode: "83cf873a-f6da-4bc8-823f-bacfd55dc430";
10 }
29
30impl mf_IMFAttributes for IMFTopologyNode {}
31impl mf_IMFTopologyNode for IMFTopologyNode {}
32
33pub trait mf_IMFTopologyNode: mf_IMFAttributes {
42 fn CloneFrom(&self, node: &impl mf_IMFTopologyNode) -> HrResult<()> {
45 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).CloneFrom)(self.ptr(), node.ptr()) })
46 .to_hrresult()
47 }
48
49 fn ConnectOutput(
52 &self,
53 output_index: u32,
54 downstream_node: &impl mf_IMFTopologyNode,
55 input_index_on_downstream_node: u32,
56 ) -> HrResult<()> {
57 HrRet(unsafe {
58 (vt::<IMFTopologyNodeVT>(self).ConnectOutput)(
59 self.ptr(),
60 output_index,
61 downstream_node.ptr(),
62 input_index_on_downstream_node,
63 )
64 })
65 .to_hrresult()
66 }
67
68 #[must_use]
71 fn DisconnectOutput(&self, output_index: u32) -> HrResult<()> {
72 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).DisconnectOutput)(self.ptr(), output_index) })
73 .to_hrresult()
74 }
75
76 #[must_use]
82 fn GetInput(&self, input_index: u32) -> HrResult<(IMFTopologyNode, u32)> {
83 let mut queried = unsafe { IMFTopologyNode::null() };
84 let mut output_index_downstream_node = 0u32;
85 HrRet(unsafe {
86 (vt::<IMFTopologyNodeVT>(self).GetInput)(
87 self.ptr(),
88 input_index,
89 queried.as_mut(),
90 &mut output_index_downstream_node,
91 )
92 })
93 .to_hrresult()
94 .map(|_| (queried, output_index_downstream_node))
95 }
96
97 #[must_use]
100 fn GetInputCount(&self) -> HrResult<u32> {
101 let mut c = 0u32;
102 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetInputCount)(self.ptr(), &mut c) })
103 .to_hrresult()
104 .map(|_| c)
105 }
106
107 #[must_use]
110 fn GetNodeType(&self) -> HrResult<co::MF_TOPOLOGY> {
111 let mut ty = co::MF_TOPOLOGY::default();
112 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetNodeType)(self.ptr(), ty.as_mut()) })
113 .to_hrresult()
114 .map(|_| ty)
115 }
116
117 #[must_use]
120 fn GetObject<T>(&self) -> HrResult<T>
121 where
122 T: ole_IUnknown,
123 {
124 let mut queried = unsafe { T::null() };
125 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetObject)(self.ptr(), queried.as_mut()) })
126 .to_hrresult()
127 .map(|_| queried)
128 }
129
130 #[must_use]
136 fn GetOutput(&self, output_index: u32) -> HrResult<(IMFTopologyNode, u32)> {
137 let mut queried = unsafe { IMFTopologyNode::null() };
138 let mut input_index_downstream_node = 0u32;
139 HrRet(unsafe {
140 (vt::<IMFTopologyNodeVT>(self).GetOutput)(
141 self.ptr(),
142 output_index,
143 queried.as_mut(),
144 &mut input_index_downstream_node,
145 )
146 })
147 .to_hrresult()
148 .map(|_| (queried, input_index_downstream_node))
149 }
150
151 #[must_use]
154 fn GetOutputCount(&self) -> HrResult<u32> {
155 let mut c = 0u32;
156 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetOutputCount)(self.ptr(), &mut c) })
157 .to_hrresult()
158 .map(|_| c)
159 }
160
161 #[must_use]
164 fn GetTopoNodeID(&self) -> HrResult<u64> {
165 let mut id = 0u64;
166 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).GetTopoNodeID)(self.ptr(), &mut id) })
167 .to_hrresult()
168 .map(|_| id)
169 }
170
171 fn SetObject(&self, object: &impl ole_IUnknown) -> HrResult<()> {
174 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).SetObject)(self.ptr(), object.ptr()) })
175 .to_hrresult()
176 }
177
178 fn SetTopoNodeID(&self, topo_id: u64) -> HrResult<()> {
181 HrRet(unsafe { (vt::<IMFTopologyNodeVT>(self).SetTopoNodeID)(self.ptr(), topo_id) })
182 .to_hrresult()
183 }
184}